package com.iotproject.eduservice.controller;

import com.iotproject.commonutils.R;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/eduservice/user")
//d @CrossOrigin
public class EduLoginController {

    @PostMapping("login")
    public R Login() {
        return R.ok().data("token", "admin");
    }

    @GetMapping("info")
    public R Info(@RequestParam("token") String token) {
        //这个 token 的值即 上述 Login()方法提供的
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://guli-edu-20221107.oss-cn-shenzhen.aliyuncs.com/2023/04/22/avatars.jpg");
    }

    @PostMapping("logout")
    public R Logout() {
        return R.ok();
    }


}
